/*
** Copyright (C) 2009 Zhang Cong <ftofficer@ftofficer.com>
**  
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**  
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**  
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**  
*/

#ifndef LIBOI_LOG_H_
#define LIBOI_LOG_H_

#include "liboi.h"

void oi_log_write(const char* file, int line, int level, const char* fmt, ...);

#define OI_LOG(level, fmt, ...) oi_log_write(__FILE__, __LINE__, level, fmt, __VA_ARGS__)
#define OI_DEBUG(fmt, ...) OI_LOG(LOG_DEBUG, fmt, __VA_ARGS__)
#define OI_NORMAL(fmt, ...) OI_LOG(LOG_NORMAL, fmt, __VA_ARGS__)
#define OI_WARN(fmt, ...) OI_LOG(LOG_WARN, fmt, __VA_ARGS__)
#define OI_ERROR(fmt, ...) OI_LOG(LOG_ERROR, fmt, __VA_ARGS__)

#endif // LIBOI_LOG_H_
